package com.wechat.entity;

import com.swak.App;
import com.swak.annotation.Table;
import com.swak.persistence.BaseMapper;
import com.swak.persistence.Model;

import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * 描述
 * 
 * @author Auto Generator
 * @date 2022-10-21T23:59:27.041546800
 */
@Getter
@Setter
@Accessors(chain = true)
@Table(value="WECHAT_CHAT_ROOM")
public class ChatRoom extends Model<ChatRoom, String> {
	
	@lombok.EqualsAndHashCode.Exclude
	@lombok.ToString.Exclude
	private static volatile transient BaseMapper<ChatRoom, String> _mapper;
	
	public static final String Id = "ID";
	public static final String NickName = "NICK_NAME";
	public static final String DisplayName = "DISPLAY_NAME";
	public static final String Announcement = "ANNOUNCEMENT";
	public static final String AnnouncementEditor = "ANNOUNCEMENT_EDITOR";
	public static final String AnnouncementPublish = "ANNOUNCEMENT_PUBLISH";
	public static final String UserCount = "USER_COUNT";
	public static final String UserNames = "USER_NAMES";
	public static final String NickNames = "NICK_NAMES";
	public static final String Flag = "FLAG";
	public static final String CreateUser = "CREATE_USER";
	public static final String ManageUser = "MANAGE_USER";
	public static final String CreateDate = "CREATE_DATE";
	public static final String UpdateDate = "UPDATE_DATE";
	public static final String DelFlag = "DEL_FLAG";
	public static final String DelAt = "DEL_AT";
	
	private String nickName;
	private String displayName;
	private String announcement;
	private String announcementEditor;
	private java.time.LocalDateTime announcementPublish;
	private Integer userCount;
	private String userNames;
	private String nickNames;
	private Integer flag;
	private String createUser;
	private String manageUser;
	
	@Override
	public String prePersist() {
		return this.initDates();
	}
	
	@Override
	@SuppressWarnings("unchecked")
	protected BaseMapper<ChatRoom, String> getSqlRunner() {
		if (_mapper == null) {
			synchronized (ChatRoom.class) {
				if (_mapper == null) {
					_mapper = (BaseMapper<ChatRoom, String>) App.getBean(getTableDefine().getMapper());
				}
			}
		}
		return _mapper;
	}
	
	public static ChatRoom of() {
	    return new ChatRoom();
	}
}
